package com.tqfframe.website;

import com.tqfframe.website.web.config.ScanTestConfig;
import com.tqfframe.website.web.config.TestConfig;
import com.tqfframe.website.web.config.domain.Car;
import com.tqfframe.website.web.config.domain.FactoryTestBean;
import com.tqfframe.website.web.config.domain.ListService;
import com.tqfframe.website.web.filter.MyFilterType;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

/**
 * @Author: 唐祺峰
 * @Date: 2020/12/25 0025 16:53
 * @Version 1.0
 */
public class TestMain {
    public static void main(String[] args) {

        AnnotationConfigApplicationContext ac=new AnnotationConfigApplicationContext(ScanTestConfig.class);
        Car car=(Car) ac.getBean("factoryTestBean");
        System.out.println(car.getClass());
        System.out.println(car.getName());

//        AnnotationConfigApplicationContext ac=new AnnotationConfigApplicationContext(TestConfig.class);
//        ListService listService= ac.getBean(ListService.class);
//        System.out.println("操作符为:"+listService.showListCmd()+",系统为:"+ac.getEnvironment().getProperty("os.name"));
//
//        TestConfig computer=(TestConfig) ac.getBean("testConfig");
//        computer.testSayHello();

        ac.close();
    }
}
